<template>
    <h1>用户投资明细</h1>

    <table class="table table-bordered" border="1">
        <thead>
            <tr>
                <th>登录用户</th>
                <th>投资项目</th>
                <th>投资金额</th>
                <th>投资时间</th>
            </tr>
        </thead>

        <tbody>
            <tr v-for="item in Info">
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.I_Name }}</td>
                <td>{{ item.UT_Money }}</td>
                <td>{{ item.UT_Date.substring(0,10)}}</td>
            </tr>
        </tbody>
    </table>


</template>

<script setup lang="ts">
import { ref,onMounted } from 'vue'
import axios from 'axios'
import { useRoute } from 'vue-router'

const Info = ref([{
    I_Id:'',
    UL_Name:'',
    I_Name:'',
    UT_Money:'',
    UT_Date:'',
}])

const route = useRoute();

console.log(route.params.Id)

onMounted(()=>{
    SearInvestShow();
})

const SearInvestShow = () =>{
    axios({
        url:'http://localhost:56707/api/Invest/SearInvestShow',
        method:'get',
        params:{
            Id:route.params.Id
        }
    })
    .then(res=>{
        console.log(res)
        Info.value = res.data
    })
    .catch(err=>{
        console.log(err)
    })
}

</script>
